package com.company.function;

/**
 * @author yingfing
 * @create 2020--09--29 17:01
 * @describe
 */
public class TestFunctionInterface3 {
    public static void main(String[] args) {
        // 3 . 自定义函数式接口
        Employee e = new Employee("zhangsan", 22, 5000.00);
        Integer ageByEmployee = getAgeByEmployee(e, employee -> employee.getAge());
        System.out.println(ageByEmployee);
    }

    public static Integer getAgeByEmployee(Employee e, EmployeeToIntFunction<Employee, Integer> employeeToIntFunction) {
        return employeeToIntFunction.apply(e);
    }
}
